
package ch.hearc.coursJava.moo.thread.hello.v2;




public class UseHelloRunnable
	{

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	public static void main(String[] args)
		{
		main();
		}

	public static void main()
		{
		Runnable runnable = new Runnable()
			{

				@Override
				public void run()
					{
					attendre(1000);
					System.out.println("Hello world from " + Thread.currentThread().getName());
					}

				private void attendre(long millisecondes)
					{
					try
						{
						Thread.sleep(millisecondes);
						}
					catch (InterruptedException e)
						{
						e.printStackTrace();
						}
					}
			};
		Thread t1 = new Thread(runnable);
		t1.setName("helloThread");
		t1.start();
		System.out.println("Fin main from " + Thread.currentThread().getName());
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	}

